#include "bsp_gpio.h"

    
void bsp_gpio_init(void)
{
	/* enable the GPIO clock */
	rcu_periph_clock_enable(RCU_GPIOA);
    rcu_periph_clock_enable(RCU_GPIOB);
	rcu_periph_clock_enable(RCU_AF);	

    /* configure GPIO port */
	gpio_pin_remap_config(GPIO_SWJ_SWDPENABLE_REMAP, ENABLE);
//	AFIO_PCF0 |= (1 << 25);
	
    gpio_init(GPIOA, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ, BEEP_CTRL_PIN | LCDK_CTRL_PIN | SPI_RESET_PIN | SPI_SCL_PIN | SPI_SDA_PIN);
	gpio_init(GPIOB, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ, RS485_MODE_PIN | SPI_DC_PIN | SPI_CS_PIN | RS485_CTRL_PIN);

    gpio_init(TOUCH_CTRL_PORT, GPIO_MODE_IPD, GPIO_OSPEED_50MHZ, TOUCH_CTRL_PIN);    // 触摸控制 下拉输入
    RS485_CTRL_DIS;
}	

